<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试执行结果 - PowerOne 自动化测试工具</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.8/dist/chart.umd.min.js"></script>
    <script>
        tailwind.config = {
            theme: {
                extend: {
                    colors: {
                        primary: '#165DFF',
                        secondary: '#36CFC9',
                        success: '#52C41A',
                        warning: '#FAAD14',
                        danger: '#FF4D4F',
                        dark: '#1D2129',
                        darker: '#0F172A',
                        'dark-card': '#272E3B',
                        'dark-hover': '#374151',
                    },
                    fontFamily: {
                        inter: ['Inter', 'system-ui', 'sans-serif'],
                    },
                }
            }
        }
    </script>
    <style type="text/tailwindcss">
        @layer utilities {
            .content-auto {
                content-visibility: auto;
            }
            .scrollbar-thin {
                scrollbar-width: thin;
            }
            .scrollbar-thumb-rounded {
                scrollbar-color: rgba(156, 163, 175, 0.5) transparent;
            }
            .log-line-passed {
                @apply text-success bg-success/5 border-l-2 border-success;
            }
            .log-line-failed {
                @apply text-danger bg-danger/5 border-l-2 border-danger;
            }
            .log-line-info {
                @apply text-gray-300 bg-dark-card;
            }
            .log-line-warning {
                @apply text-warning bg-warning/5 border-l-2 border-warning;
            }
        }
    </style>
</head>
<body class="bg-darker text-gray-200 font-inter h-screen flex flex-col overflow-hidden">
    <!-- Header -->
    <header class="bg-dark border-b border-gray-700 py-3 px-4 flex items-center justify-between">
        <div class="flex items-center space-x-4">
            <button class="lg:hidden text-gray-400 hover:text-white">
                <i class="fa fa-bars text-xl"></i>
            </button>
            <div class="flex items-center">
                <div class="w-8 h-8 rounded-md bg-primary flex items-center justify-center mr-2">
                    <i class="fa fa-cogs text-white"></i>
                </div>
                <h1 class="text-xl font-bold text-white">PowerOne</h1>
            </div>
        </div>
        <div class="flex items-center space-x-6">
            <div class="flex items-center space-x-3">
                <button class="px-4 py-2 bg-primary hover:bg-primary/90 text-white rounded-lg text-sm font-medium transition-colors flex items-center">
                    <i class="fa fa-download mr-2"></i> 导出报告
                </button>
                <button class="px-4 py-2 bg-dark-card hover:bg-dark-hover text-white rounded-lg text-sm font-medium transition-colors flex items-center">
                    <i class="fa fa-share-alt mr-2"></i> 分享
                </button>
                <button class="px-4 py-2 bg-success hover:bg-success/90 text-white rounded-lg text-sm font-medium transition-colors flex items-center">
                    <i class="fa fa-repeat mr-2"></i> 重跑
                </button>
            </div>
        </div>
    </header>

    <div class="flex flex-1 overflow-hidden">
        <!-- Sidebar -->
        <aside class="bg-dark w-16 lg:w-64 border-r border-gray-700 flex flex-col transition-all duration-300">
            <nav class="flex-1 py-4 overflow-y-auto">
                <ul class="space-y-1 px-2">
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-400 hover:bg-dark-hover hover:text-white transition-colors">
                            <i class="fa fa-tachometer text-xl w-6 text-center"></i>
                            <span class="lg:inline text-sm font-medium">控制台</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-400 hover:bg-dark-hover hover:text-white transition-colors">
                            <i class="fa fa-folder-open text-xl w-6 text-center"></i>
                            <span class="lg:inline text-sm font-medium">项目管理</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-400 hover:bg-dark-hover hover:text-white transition-colors">
                            <i class="fa fa-list-alt text-xl w-6 text-center"></i>
                            <span class="lg:inline text-sm font-medium">测试用例</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-4 py-3 rounded-lg bg-primary/10 text-primary">
                            <i class="fa fa-play-circle text-xl w-6 text-center"></i>
                            <span class="lg:inline text-sm font-medium">测试执行</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-400 hover:bg-dark-hover hover:text-white transition-colors">
                            <i class="fa fa-bar-chart text-xl w-6 text-center"></i>
                            <span class="lg:inline text-sm font-medium">测试报告</span>
                        </a>
                    </li>
                    <li>
                        <a href="#" class="flex items-center space-x-3 px-4 py-3 rounded-lg text-gray-400 hover:bg-dark-hover hover:text-white transition-colors">
                            <i class="fa fa-bug text-xl w-6 text-center"></i>
                            <span class="lg:inline text-sm font-medium">缺陷管理</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </aside>

        <!-- Main Content -->
        <main class="flex-1 overflow-hidden flex flex-col">
            <!-- Test Execution Header -->
            <div class="bg-dark-card border-b border-gray-700 p-4">
                <div class="flex flex-col md:flex-row md:items-center md:justify-between">
                    <div>
                        <div class="flex items-center">
                            <h2 class="text-xl font-bold text-white">用户登录测试用例 - 执行结果</h2>
                            <span class="ml-3 px-2 py-0.5 bg-danger/20 text-danger text-xs rounded-full">部分失败</span>
                        </div>
                        <div class="flex flex-wrap items-center gap-4 mt-2 text-sm">
                            <div class="flex items-center text-gray-400">
                                <i class="fa fa-clock-o mr-2 text-gray-500"></i>
                                <span>开始时间: 2025-09-03 15:30:22</span>
                            </div>
                            <div class="flex items-center text-gray-400">
                                <i class="fa fa-clock-o mr-2 text-gray-500"></i>
                                <span>结束时间: 2025-09-03 15:32:45</span>
                            </div>
                            <div class="flex items-center text-gray-400">
                                <i class="fa fa-timer mr-2 text-gray-500"></i>
                                <span>持续时间: 2分23秒</span>
                            </div>
                            <div class="flex items-center text-gray-400">
                                <i class="fa fa-browser mr-2 text-gray-500"></i>
                                <span>Chrome 128.0.0.0</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Execution Tabs -->
            <div class="bg-dark border-b border-gray-700 flex">
                <button class="px-6 py-3 text-primary border-b-2 border-primary font-medium text-sm flex items-center">
                    <i class="fa fa-list-alt mr-2"></i> 测试结果
                </button>
                <button class="px-6 py-3 text-gray-400 hover:text-white font-medium text-sm flex items-center">
                    <i class="fa fa-terminal mr-2"></i> 执行日志
                </button>
                <button class="px-6 py-3 text-gray-400 hover:text-white font-medium text-sm flex items-center">
                    <i class="fa fa-picture-o mr-2"></i> 截图对比
                </button>
                <button class="px-6 py-3 text-gray-400 hover:text-white font-medium text-sm flex items-center">
                    <i class="fa fa-bar-chart mr-2"></i> 统计分析
                </button>
            </div>

            <!-- Test Results Content -->
            <div class="flex-1 overflow-hidden flex">
                <!-- Summary Panel -->
                <div class="w-80 border-r border-gray-700 bg-dark p-4 overflow-y-auto">
                    <h3 class="text-sm font-semibold text-gray-300 uppercase mb-4">执行摘要</h3>

                    <!-- Statistics Cards -->
                    <div class="space-y-4 mb-6">
                        <div class="bg-dark-card rounded-lg p-4">
                            <div class="flex items-center justify-between mb-2">
                                <span class="text-xs text-gray-400">总用例数</span>
                                <span class="text-lg font-bold text-white">12</span>
                            </div>
                            <div class="w-full bg-dark rounded-full h-2">
                                <div class="bg-primary h-2 rounded-full" style="width: 100%"></div>
                            </div>
                        </div>

                        <div class="grid grid-cols-2 gap-3">
                            <div class="bg-dark-card rounded-lg p-4">
                                <div class="text-center">
                                    <div class="text-2xl font-bold text-success">8</div>
                                    <div class="text-xs text-gray-400 mt-1">通过</div>
                                </div>
                            </div>
                            <div class="bg-dark-card rounded-lg p-4">
                                <div class="text-center">
                                    <div class="text-2xl font-bold text-danger">2</div>
                                    <div class="text-xs text-gray-400 mt-1">失败</div>
                                </div>
                            </div>
                            <div class="bg-dark-card rounded-lg p-4">
                                <div class="text-center">
                                    <div class="text-2xl font-bold text-warning">1</div>
                                    <div class="text-xs text-gray-400 mt-1">阻塞</div>
                                </div>
                            </div>
                            <div class="bg-dark-card rounded-lg p-4">
                                <div class="text-center">
                                    <div class="text-2xl font-bold text-gray-400">1</div>
                                    <div class="text-xs text-gray-400 mt-1">跳过</div>
                                </div>
                            </div>
                        </div>

                        <div class="bg-dark-card rounded-lg p-4">
                            <div class="flex items-center justify-between mb-2">
                                <span class="text-xs text-gray-400">通过率</span>
                                <span class="text-lg font-bold text-success">66.7%</span>
                            </div>
                            <div class="w-full bg-dark rounded-full h-2">
                                <div class="bg-success h-2 rounded-full" style="width: 66.7%"></div>
                            </div>
                        </div>
                    </div>

                    <!-- Environment Info -->
                    <div class="mb-6">
                        <h4 class="text-xs text-gray-500 uppercase mb-3">环境信息</h4>
                        <div class="bg-dark-card rounded-lg p-4 space-y-3 text-sm">
                            <div>
                                <div class="text-xs text-gray-500">测试环境</div>
                                <div class="text-gray-300">生产环境</div>
                            </div>
                            <div>
                                <div class="text-xs text-gray-500">浏览器</div>
                                <div class="text-gray-300">Chrome 128.0.0.0</div>
                            </div>
                            <div>
                                <div class="text-xs text-gray-500">分辨率</div>
                                <div class="text-gray-300">1920x1080</div>
                            </div>
                            <div>
                                <div class="text-xs text-gray-500">执行机</div>
                                <div class="text-gray-300">WIN-TEST-01</div>
                            </div>
                            <div>
                                <div class="text-xs text-gray-500">执行人</div>
                                <div class="text-gray-300">测试管理员</div>
                            </div>
                        </div>
                    </div>

                    <!-- Failure Analysis -->
                    <div>
                        <h4 class="text-xs text-gray-500 uppercase mb-3">失败分析</h4>
                        <div class="bg-dark-card rounded-lg p-4 space-y-3">
                            <div class="flex items-center justify-between text-sm">
                                <span class="text-gray-300">元素定位失败</span>
                                <span class="px-2 py-0.5 bg-danger/20 text-danger text-xs rounded-full">1</span>
                            </div>
                            <div class="flex items-center justify-between text-sm">
                                <span class="text-gray-300">断言失败</span>
                                <span class="px-2 py-0.5 bg-danger/20 text-danger text-xs rounded-full">1</span>
                            </div>
                            <div class="flex items-center justify-between text-sm">
                                <span class="text-gray-300">页面加载超时</span>
                                <span class="px-2 py-0.5 bg-warning/20 text-warning text-xs rounded-full">1</span>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Test Case Results -->
                <div class="flex-1 bg-darker p-6 overflow-y-auto">
                    <div class="max-w-4xl mx-auto">
                        <div class="bg-dark-card rounded-xl p-6 mb-6">
                            <div class="flex items-center justify-between mb-6">
                                <h3 class="text-lg font-semibold text-white">测试用例结果</h3>
                                <div class="flex items-center space-x-2">
                                    <select class="bg-dark border border-gray-600 rounded px-3 py-1.5 text-sm focus:outline-none focus:ring-1 focus:ring-primary text-gray-300">
                                        <option>全部状态</option>
                                        <option>通过</option>
                                        <option>失败</option>
                                        <option>阻塞</option>
                                        <option>跳过</option>
                                    </select>
                                    <button class="text-gray-400 hover:text-white">
                                        <i class="fa fa-search"></i>
                                    </button>
                                </div>
                            </div>

                            <!-- Test Case Results List -->
                            <div class="space-y-4">
                                <!-- Passed Test Case -->
                                <div class="border border-gray-700 rounded-lg overflow-hidden">
                                    <div class="bg-dark p-3 flex items-center justify-between">
                                        <div class="flex items-center">
                                            <div class="w-6 h-6 rounded-full bg-success flex items-center justify-center mr-3">
                                                <i class="fa fa-check text-white text-xs"></i>
                                            </div>
                                            <div>
                                                <h4 class="text-sm font-medium text-white">打开登录页面</h4>
                                                <div class="text-xs text-gray-400">步骤 1/12</div>
                                            </div>
                                        </div>
                                        <div class="flex items-center space-x-2">
                                            <span class="text-xs text-gray-400">0.8s</span>
                                            <button class="text-gray-400 hover:text-white text-sm">
                                                <i class="fa fa-chevron-down"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>

                                <!-- Passed Test Case -->
                                <div class="border border-gray-700 rounded-lg overflow-hidden">
                                    <div class="bg-dark p-3 flex items-center justify-between">
                                        <div class="flex items-center">
                                            <div class="w-6 h-6 rounded-full bg-success flex items-center justify-center mr-3">
                                                <i class="fa fa-check text-white text-xs"></i>
                                            </div>
                                            <div>
                                                <h4 class="text-sm font-medium text-white">输入用户名</h4>
                                                <div class="text-xs text-gray-400">步骤 2/12</div>
                                            </div>
                                        </div>
                                        <div class="flex items-center space-x-2">
                                            <span class="text-xs text-gray-400">0.5s</span>
                                            <button class="text-gray-400 hover:text-white text-sm">
                                                <i class="fa fa-chevron-down"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>

                                <!-- Passed Test Case -->
                                <div class="border border-gray-700 rounded-lg overflow-hidden">
                                    <div class="bg-dark p-3 flex items-center justify-between">
                                        <div class="flex items-center">
                                            <div class="w-6 h-6 rounded-full bg-success flex items-center justify-center mr-3">
                                                <i class="fa fa-check text-white text-xs"></i>
                                            </div>
                                            <div>
                                                <h4 class="text-sm font-medium text-white">输入密码</h4>
                                                <div class="text-xs text-gray-400">步骤 3/12</div>
                                            </div>
                                        </div>
                                        <div class="flex items-center space-x-2">
                                            <span class="text-xs text-gray-400">0.4s</span>
                                            <button class="text-gray-400 hover:text-white text-sm">
                                                <i class="fa fa-chevron-down"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>

                                <!-- Failed Test Case -->
                                <div class="border border-danger/50 rounded-lg overflow-hidden">
                                    <div class="bg-dark p-3 flex items-center justify-between">
                                        <div class="flex items-center">
                                            <div class="w-6 h-6 rounded-full bg-danger flex items-center justify-center mr-3">
                                                <i class="fa fa-times text-white text-xs"></i>
                                            </div>
                                            <div>
                                                <h4 class="text-sm font-medium text-white">点击登录按钮</h4>
                                                <div class="text-xs text-gray-400">步骤 4/12</div>
                                            </div>
                                        </div>
                                        <div class="flex items-center space-x-2">
                                            <span class="text-xs text-danger">5.0s</span>
                                            <button class="text-gray-400 hover:text-white text-sm">
                                                <i class="fa fa-chevron-up"></i>
                                            </button>
                                        </div>
                                    </div>

                                    <!-- Expanded Failure Details -->
                                    <div class="bg-dark-card p-4 border-t border-gray-700">
                                        <div class="mb-4">
                                            <h5 class="text-xs font-medium text-gray-400 uppercase mb-2">错误信息</h5>
                                            <div class="bg-dark rounded p-3 text-sm text-danger text-wrap">
                                                ElementNotVisibleException: 元素不可见 - 无法点击登录按钮
                                            </div>
                                        </div>

                                        <div class="mb-4">
                                            <h5 class="text-xs font-medium text-gray-400 uppercase mb-2">失败截图</h5>
                                            <div class="border border-gray-700 rounded overflow-hidden">
                                                <img src="https://images.unsplash.com/photo-1551434678-e076c223a692?ixlib=rb-1.2.1&auto=format&fit=crop&w=600&q=80" alt="Failure Screenshot" class="w-full h-auto">
                                            </div>
                                        </div>

                                        <div>
                                            <h5 class="text-xs font-medium text-gray-400 uppercase mb-2">相关日志</h5>
                                            <div class="bg-dark rounded p-3 text-xs space-y-1 max-h-40 overflow-y-auto scrollbar-thin scrollbar-thumb-rounded">
                                                <div class="log-line-info px-2 py-1">[15:30:45] INFO: 正在查找元素: button#loginBtn</div>
                                                <div class="log-line-info px-2 py-1">[15:30:46] INFO: 元素已找到</div>
                                                <div class="log-line-warning px-2 py-1">[15:30:46] WARN: 元素可见性低: 56%</div>
                                                <div class="log-line-info px-2 py-1">[15:30:46] INFO: 尝试点击元素</div>
                                                <div class="log-line-failed px-2 py-1">[15:30:50] ERROR: 元素不可见，无法执行点击操作</div>
                                                <div class="log-line-failed px-2 py-1">[15:30:50] ERROR: ElementNotVisibleException: 元素不可见 - 无法点击登录按钮</div>
                                            </div>
                                        </div>

                                        <div class="mt-4 flex justify-end space-x-2">
                                            <button class="px-3 py-1.5 bg-dark hover:bg-dark-hover text-sm rounded text-gray-300 transition-colors">
                                                <i class="fa fa-bug mr-1"></i> 创建缺陷
                                            </button>
                                            <button class="px-3 py-1.5 bg-success hover:bg-success/90 text-sm rounded text-white transition-colors">
                                                <i class="fa fa-repeat mr-1"></i> 重跑用例
                                            </button>
                                        </div>
                                    </div>
                                </div>

                                <!-- Passed Test Case -->
                                <div class="border border-gray-700 rounded-lg overflow-hidden">
                                    <div class="bg-dark p-3 flex items-center justify-between">
                                        <div class="flex items-center">
                                            <div class="w-6 h-6 rounded-full bg-success flex items-center justify-center mr-3">
                                                <i class="fa fa-check text-white text-xs"></i>
                                            </div>
                                            <div>
                                                <h4 class="text-sm font-medium text-white">验证登录成功跳转</h4>
                                                <div class="text-xs text-gray-400">步骤 5/12</div>
                                            </div>
                                        </div>
                                        <div class="flex items-center space-x-2">
                                            <span class="text-xs text-gray-400">2.1s</span>
                                            <button class="text-gray-400 hover:text-white text-sm">
                                                <i class="fa fa-chevron-down"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>

                                <!-- Skipped Test Case -->
                                <div class="border border-gray-700 rounded-lg overflow-hidden">
                                    <div class="bg-dark p-3 flex items-center justify-between">
                                        <div class="flex items-center">
                                            <div class="w-6 h-6 rounded-full bg-gray-500 flex items-center justify-center mr-3">
                                                <i class="fa fa-forward text-white text-xs"></i>
                                            </div>
                                            <div>
                                                <h4 class="text-sm font-medium text-gray-400">验证用户头像显示</h4>
                                                <div class="text-xs text-gray-500">步骤 6/12 - 已跳过</div>
                                            </div>
                                        </div>
                                        <div class="flex items-center space-x-2">
                                            <span class="text-xs text-gray-500">0.0s</span>
                                            <button class="text-gray-400 hover:text-white text-sm">
                                                <i class="fa fa-chevron-down"></i>
                                            </button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </main>
    </div>

    <script>
        // Tab switching functionality
        document.addEventListener('DOMContentLoaded', function() {
            const tabs = document.querySelectorAll('.bg-dark button');
            tabs.forEach(tab => {
                tab.addEventListener('click', function() {
                    // Remove active state from all tabs
                    tabs.forEach(t => {
                        t.classList.remove('text-primary', 'border-b-2', 'border-primary');
                        t.classList.add('text-gray-400');
                    });

                    // Add active state to clicked tab
                    this.classList.add('text-primary', 'border-b-2', 'border-primary');
                    this.classList.remove('text-gray-400');
                });
            });

            // Toggle test case details
            const toggleButtons = document.querySelectorAll('.fa-chevron-down, .fa-chevron-up');
            toggleButtons.forEach(button => {
                button.parentElement.addEventListener('click', function() {
                    const icon = this.querySelector('i');
                    const detailsSection = this.closest('div').nextElementSibling;

                    if (detailsSection && detailsSection.classList.contains('border-t')) {
                        detailsSection.classList.toggle('hidden');
                        if (icon.classList.contains('fa-chevron-down')) {
                            icon.classList.replace('fa-chevron-down', 'fa-chevron-up');
                        } else {
                            icon.classList.replace('fa-chevron-up', 'fa-chevron-down');
                        }
                    }
                });
            });
        });
    </script>
</body>
</html>